
package org.pqw.ossmodel.controller;

import org.pqw.commonapi.FileIOService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;

@RestController
@RequestMapping("/")
public class FileIOController {
    @Autowired
    FileIOService fileIOService;
    @RequestMapping("download/{uri}")
    public Object downloadFile(@PathVariable("uri") String uri, HttpServletResponse res) {
        OutputStream os = fileIOService.downloadFile(uri);
        return os;
    }

}
